<template>
  <div id="base">
    子组件：<input type="text" v-model="data1"> 
	 <div>{{age}}</div>
	<div>{{data1}} </div>
	<button v-on:click="sendMessToParent">向父组件传值</button>
  </div>
</template>
 
<script>
export default {
  name: 'base',
  data(){
  return {message:'This is a child component!',
          age:18}
  },
  methods:{
  sendMessToParent:function(){
  this.$emit("listenChildEvent","this message from Child");
  }
  },
  props:["data1"]
  
  
}
</script>
 
<style>
#test {
  width: 400px;
  height: 400px;
  margin: 40px auto;
}
</style>